home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_bas
/
mices
/
inkey.bas
< prev
next >
Wrap
BASIC Source File
|
1988-04-16
|
2KB
|
79 lines
DEFINT A-Z: KEY OFF: COLOR 7,0: CLS
GOSUB Initialize
GOSUB Write.Screen
GOSUB Get.Inputs
END
Initialize:
'============
FG=7
AC=1
EC=27
FMT=0
HL=15
UP.CURSOR=72
ID!=123.4567
LAST.NAME$="SCHWARZ"
FIRST.NAME$="Raymond"
TEL$="(713) 721-6104"
RETURN
Write.Screen:
'============
LOCATE 8,10
PRINT "ID NUMBER... (Only numeric entry allowed)"
LOCATE 10,10
PRINT "LAST NAME... (Uppercase forced)"
LOCATE 12,10
PRINT "FIRST NAME.. (Upper or lower allowed. Try up cursor)"
LOCATE 14,10
PRINT "Telephone... (Default value given. Format forced.)"
LOCATE 16,10
PRINT "Code ......."
LOCATE 17,10
PRINT "(First 2 letters forced to caps, next 2 numbers, next 2 any.)"
RETURN
Get.Inputs:
'==========
In.Num:
ROW=8: COL=22: AC=0: CHAR.CODE=2: FL=8 '2: Numeric only
PROMPT$=MID$(STR$(ID!),2): CONTROL$=""
CALL INKEY(ROW,COL,AC,CHAR.CODE,FL,PROMPT$,CONTROL$,IN$,MOVE.IT,KY)
IF KY = EC THEN RETURN ELSE ID!=VAL(IN$)
In.Cap:
ROW=10: COL=22: AC=0: CHAR.CODE=13: FL=15 '13: Uppercase & blanks only
PROMPT$=LAST.NAME$: CONTROL$=""
CALL INKEY(ROW,COL,AC,CHAR.CODE,FL,PROMPT$,CONTROL$,IN$,MOVE.IT,KY)
IF KY = EC THEN RETURN ELSE LAST.NAME$=IN$
IF KY=UP.CURSOR GOTO In.Num
In.Any:
ROW=12: COL=22: AC=-1: CHAR.CODE=23: FL=15 '23:: Any (Auto Cap on)
PROMPT$=FIRST.NAME$: CONTROL$=""
CALL INKEY(ROW,COL,AC,CHAR.CODE,FL,PROMPT$,CONTROL$,IN$,MOVE.IT,KY)
IF KY = EC THEN RETURN ELSE FIRST.NAME$=IN$
IF KY=UP.CURSOR GOTO In.Cap
In.Control:
ROW=14: COL=22: AC=0: CHAR.CODE=0: FL=14
PROMPT$=TEL$: CONTROL$="(###) ###-####" 'Controlled Format
CALL INKEY(ROW,COL,AC,CHAR.CODE,FL,PROMPT$,CONTROL$,IN$,MOVE.IT,KY)
IF KY = EC THEN RETURN ELSE TEL$=IN$
IF KY=UP.CURSOR GOTO In.Any
In.Code:
ROW=16: COL=22: AC=0: CHAR.CODE=0: FL=8
CONTROL$="UU-##-__"
IF IN.CODE$="" THEN PROMPT$=CONTROL$ ELSE PROMPT$=IN.CODE$
CALL INKEY(ROW,COL,AC,CHAR.CODE,FL,PROMPT$,CONTROL$,IN$,MOVE.IT,KY)
IF KY = EC THEN RETURN ELSE IN.CODE$=IN$
IF KY=UP.CURSOR GOTO In.Control
RETURN